package cn.lili.modules.payment.entity.dos;

import cn.lili.mybatis.model.BaseEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 合单支付日志
 *
 * @author Chopper
 * @since 2021/1/28 09:21
 */
@Data
@TableName("li_combine_payment_log")
@Builder
@ApiModel(value = "合单支付日志")
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class CombinePaymentLog extends BaseEntity {


    private static final long serialVersionUID = 5349949725444117492L;

    @ApiModelProperty(value = "订单编号")
    private String orderSn;

    /**
     * @see cn.lili.modules.payment.entity.enums.PaymentClientEnum
     */
    @ApiModelProperty(value = "订单支付方式")
    private String paymentClient;

    /**
     * @see cn.lili.modules.payment.entity.enums.PaymentMethodEnum
     */
    @ApiModelProperty(value = "支付方式")
    private String paymentMethod;

    @ApiModelProperty(value = "已校验回查")
    private Boolean isCheck = false;

    @ApiModelProperty(value = "合单商户APPID")
    private String combineAppid;

    @ApiModelProperty(value = "合单商户号")
    private String combineMchid;

    @ApiModelProperty(value = "合单支付总金额")
    private Double price;

    @ApiModelProperty(value = "合单支付对第三方请求单号")
    private String combineOutTradeNo;

    @ApiModelProperty(value = "支付请求参数")
    private String paymentRequestSource;

    @ApiModelProperty(value = "支付响应")
    private String paymentResponseSource;

    @ApiModelProperty(value = "付款人ID")
    private String payerId;

    @ApiModelProperty(value = "付款人OPENID")
    private String openid;


    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "支付过期时间", hidden = true)
    private Date timeoutExpress;

    @CreatedDate
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间", hidden = true)
    private Date createTime;

}